project("Feature")

add_executable(Feature
        FeatureExample.cpp
)

add_dependencies(Feature LibDGGSKernel LibDGGSFeature)

if(CMAKE_BUILD_TYPE STREQUAL "Debug")
    target_link_libraries(Feature
            LibDGGSKernelD
            LibDGGSFeatureD
    )
    add_custom_command(
            TARGET Feature
            POST_BUILD
            COMMAND ${CMAKE_COMMAND} -E copy
            ${DGGS_OUT_DIR}/LibDGGSKernel/LibDGGSKernelD.dll
            ${CMAKE_BINARY_DIR}/Example/cpp/Feature/LibDGGSKernelD.dll
    )
    add_custom_command(
            TARGET Feature
            POST_BUILD
            COMMAND ${CMAKE_COMMAND} -E copy
            ${DGGS_OUT_DIR}/LibDGGSFeature/LibDGGSFeatureD.dll
            ${CMAKE_BINARY_DIR}/Example/cpp/Feature/LibDGGSFeatureD.dll
    )
else ()
    target_link_libraries(Feature
            LibDGGSKernel
            LibDGGSFeature
    )
    add_custom_command(
            TARGET Feature
            POST_BUILD
            COMMAND ${CMAKE_COMMAND} -E copy
            ${DGGS_OUT_DIR}/LibDGGSKernel/LibDGGSKernel.dll
            ${CMAKE_BINARY_DIR}/Example/cpp/Feature/LibDGGSKernel.dll
    )
    add_custom_command(
            TARGET Feature
            POST_BUILD
            COMMAND ${CMAKE_COMMAND} -E copy
            ${DGGS_OUT_DIR}/LibDGGSFeature/LibDGGSFeature.dll
            ${CMAKE_BINARY_DIR}/Example/cpp/Feature/LibDGGSFeature.dll)
endif ()


add_custom_command(
        TARGET Feature
        POST_BUILD
        COMMAND ${CMAKE_COMMAND} -E copy
        ${CMAKE_SOURCE_DIR}/3rdlibs/bin/jsoncpp.dll
        ${CMAKE_BINARY_DIR}/Example/cpp/Feature/jsoncpp.dll)

